package com.four.mapper;

import com.four.entity.Permission;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PermissionMapper {
    int deleteByPrimaryKey(Integer pId);

    int insert(Permission record);

    int insertSelective(Permission record);

    Permission selectByPrimaryKey(Integer pId);

    int updateByPrimaryKeySelective(Permission record);

    int updateByPrimaryKey(Permission record);

    /**
     * 查询所有权限
     * @return
     */
    List<Permission> selectAll();
    //查询权限
    List<Permission> findByAdminId(Integer adminid);


    List<Integer> selectByRoleId(Integer roleId);

    void deleteByRoleId(Integer roleId);


    void batchPermission(@Param("roleId") Integer roleId,@Param("permissionIds") Integer[] permissionIds);
}